/*
 * All rights Reserved, Designed By DataDriver
 * Copyright:    DataDriver.Inc
 * Company:      Zhuo Wo Infomation Technology (ShangHai) CO.LTD
 */
package com.sun.aware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.stereotype.Component;

/**
 * 自定义自己的工厂Bean
 */

@Component
public class MyBeanFactoryAware implements BeanFactoryAware {

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        boolean b = beanFactory.containsBean("beanConfig");
        if(b){
            System.out.println("当前查询的bean存在IOC容器中");
        }else{
            System.out.println("当前的Bean对象不存在IOC容器中");
        }
    }
}
